<!-- add.html文件 -->
<#include "./scripts_purPlan.html">

<style>
	.fream-top-right > ul > li:hover > .margin0 {
		margin: -10px -4px 0px;
	}

	.border tbody tr td:nth-child(odd) {
		width: 150px;
	}

	.border tbody tr td:nth-child(even) {
		width: 200px;
	}
</style>

<div class="page-content detail-content page-content-main" style="background-color: #EEF1F6; min-height:700px;">
	<form action="" method="post" id="addForm" class="form-horizontal">
		<div class="fh-subtitle">新增采购计划</div>
		<table class="border">
			<tr>
				<td>计划单号</td>
				<td style="position: relative;"><input type="text" class="form-control-gx" name="planNo" id="planNo"/></td>
				<td>标题</td>
				<td><input type="text" class="form-control-gx" name="title" id="title"></td>
			</tr>
		</table>
		<div style="text-align:center;padding:50px;">
			<span class="model-btn" id="btn_confirm" onclick="submit()">确定</span>
		</div>
	</form>
</div>


<script type="text/javascript">

	/**
	 * 新增采购计划。
	 */
	function submit() {
		if ($("#planNo").val() == "") {
			js.showMessage("采购编号不能为空！", null, "warning", 1500);
			return;
		}
		if ($("#title").val() == "") {
			js.showMessage("标题不能为空！", null, "warning", 1500);
			return;
		}

		var data = $("#addForm").serialize();

		sys.getApiData("addPurPlan", data, function (data) {
			//console.log("addPurPlan.response.data", data);
			if (data.success) {
				js.showMessage("新增采购计划成功!", null, "success", 1500);
				js.closeCurrentTabPage(function (contentWindow) {
					contentWindow.reload();
				});
			} else {
				js.showMessage(data.message,null,"error",1500);
			}
		});
	}

</script>
